import React from "react"

let scaleNames = {
    c: "摄氏度",
    f: "华氏度"
}

class TemperatureInput extends React.Component {
    handleChange = (e) => {
        // console.log(this.props)
        this.props.onInputChange(e.target.value)
    }
    render() {
        let { scale, temperature } = this.props;
        return (
            <fieldset>
                <legend>请输入:{scaleNames[scale]}</legend>
                <input type="text" onChange={this.handleChange} value={temperature} />

            </fieldset>
        )
    }
}

export default TemperatureInput